Concise Concrete Syntax

نویسندگان

  • Stephen Tse
  • Steve Zdancewic
چکیده

We introduce a notion of ordered context-free grammars (OCFGs) with datatype tags to concisely specify grammars of programming languages. Our work is an extension of syntax definition formalism (SDF) and concrete datatypes that automate scanning, parsing, and syntax tree construction. But OCFGs also capture associativity and precedence at the level of production rules instead of lexical tokens such that a concrete syntax grammar is succinct enough be an abstract syntax definition. By expanding and re-indexing grammar symbols, OCFGs can be translated to grammars for standard lex and yacc such that existing and efficient parsing infrastructures can be reused. We have implemented a Java 5 compiler frontend with OCFGs. The complete grammar for such a realistic language fits comfortably in two pages of this paper, showing the practicality of our formalism.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

The GF Grammar Compiler

GF (Grammatical Framework) is a grammar formalism based on the distinction between abstract and concrete syntax. An abstract syntax is a free algebra of trees, and a concrete syntax is a mapping from trees to nested records of strings and features. These mappings are naturally defined as functions in a functional programming language; the GF language provides the customary functional programmin...

متن کامل

Comparison of Three Model Transformation Languages

In this paper we compare three model transformation languages: 1) Concrete syntax-based graph transformation (CGT) which is our emerging model transformation language, 2) Attributed Graph Grammar (AGG) representing traditional graph transformation, and 3) Atlas Transformation Language (ATL) representing model transformation. Our case study is a fairly complicated refactoring of UML activity mod...

متن کامل

LinearOperator - A generic, high-level expression syntax for linear algebra

We introduce an expression syntax for the evaluation of matrix-matrix, matrix-vector and vector-vector operations. The implementation is similar to the well-known general concept of expression templates as used, for example, in the C++ linear-algebra libraries Eigen and Blaze. The novelty of the approach that is discussed here lies in the use of new C++11 features like lambda expressions and st...

متن کامل

Experimentation of a Graphical Concrete Syntax Generator for Domain Specific Modeling Languages

Graphical Domain Specific Modeling Languages (DSML) are alternatives to general purpose modeling languages e.g. UML or SysML. They describe models with concepts and relations specific to a domain. Defining such languages consists of defining an abstract syntax and a graphical concrete syntax accompanied by a correspondence mappingsyntax and a graphical concrete syntax accompanied by a correspon...

متن کامل

Meta-programming with Concrete Object Syntax

Meta programs manipulate structured representations, i.e., abstract syntax trees, of programs. The conceptual distance between the concrete syntax meta-programmers use to reason about programs and the notation for abstract syntax manipulation provided by general purpose (meta-) programming languages is too great for many applications. In this paper it is shown how the syntax definition formalis...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2005